<?php

# Define a setup function
$wgExtensionFunctions[] = 'wcStyle_Setup';
# Add a hook to initialise the magic word
$wgHooks['LanguageGetMagic'][]       = 'wcStyle_Magic';

function wcStyle_Setup() {
        global $wgParser;
        # Set a function hook associating the "example" magic word with our function
        $wgParser->setFunctionHook( 'wcstylez', 'wcStyle_Render' );
}

function wcStyle_Magic( &$magicWords, $langCode ) {
        # Add the magic word
        # The first array element is case sensitive, in this case it is not case sensitive
        # All remaining elements are synonyms for our parser function
        $magicWords['wcstylez'] = array( 0, 'wcstylez' );
        # unless we return true, other parser functions extensions won't get loaded.
        return true;
}

function wcStyle_Render( &$parser, $param1 = '', $param2 = '' ) {
        # The parser function itself
        # The input parameters are wikitext with templates expanded
        # The output should be wikitext too
	$parser->mOutput->addHeadItem("<link href=\"http://localhost/mediawiki/src/mediawiki-1.10.0/skins/simple/main.css\" rel=\"stylesheet\" type=\"text/css\">");
	#$output = $param1.$param2;        
	return $output;
}

?>
